#!/bin/bash
#DSUB -n octopus_01
#DSUB --job_type cosched
#DSUB -N 1
#DSUB -R "cpu=128"
#DSUB -A root.account-hjc
#DSUB -q root.default
##DSUB -l test1
#DSUB -o %J_out.log
#DSUB -e %J_err.log

export HOSTFILE=hostfile.gfs
rm -f $HOSTFILE
touch $HOSTFILE
`cat ${CCSCHEDULER_ALLOC_FILE} | sort | awk -v fff="$HOSTFILE" '{}
{
        split($0, a, " ")
        if (length(a[1]) >0 && length(a[3]) >0) {
                print a[1]" slots="128 >> fff
        }
}'`

echo "hmpi hostfile $HOSTFILE generated:"
echo "-----------------------"
cat $HOSTFILE
echo "-----------------------"

##配置环境变量
os=`cat /etc/os-release|grep VERSION_ID|awk -F \" '{print $2}'`





module use /share/home/top_software/sunqian/hpcrunner-old/software/modulefiles
module load kgcc/9.3.1
module load bisheng/2.1.0
module load hmpi/1.1.1

#export LD_LIBRARY_PATH=/mnt/software/compilers/bisheng/3.1.0/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/share/home/top_software/sunqian/lib:$LD_LIBRARY_PATH
module use $target_path/octopus/octopus-11.4/
module load $target_path/octopus/octopus-11.4/octopus_modulefiles
export PATH=/share/home/top_software/sunqian/hpcrunner-old/tmp/nwchem-6.8.1-release/bin/LINUX64:$PATH


numcpu=128

echo "-----------------------"
echo $os
echo "-----------------------"


cd web/benchmarks/dft



cd /share/home/top_software/sunqian/octopus-11.4/testsuite/finite_systems_3d
#cp 23-go-na2.03-fire.inp inp
time -p mpirun --allow-run-as-root -np 128 -x OMP_NUM_THREADS=1 octopus

